package it.univaq.tlp.library.business.impl;

import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Set;

import it.univaq.tlp.library.TitleManager;
import it.univaq.tlp.library.business.BusinessException;
import it.univaq.tlp.library.business.model.Title;
import it.univaq.tlp.library.business.model.TitleKind;

public class MemoryTitleManager implements TitleManager{
	
	private static final TitleKind LIBRO = new TitleKind(1, "Libro");
	
	protected static List<Title> titles = new ArrayList<Title>();		
	static {
		titles.add( new Title("Thinking in Java - volume 1", "Bruce Eckel", "Manuale di Java. I fondamenti", "8871923030", 2006, "Pearson", LIBRO));
		titles.add( new Title("Thinking in Java - volume 2", "Bruce Eckel", "Manuale di Java. Tecniche Avanzate", "8871923049", 2006, "Pearson", LIBRO));
		titles.add( new Title("Thinking in Java - volume 3", "Bruce Eckel", "Manuale di Java. Concorrenza ed interfacce grafiche", "8871923057", 2006, "Pearson", LIBRO));
	};	
	
	
	/*static Set<Title> s = new HashSet<Title>();
	static {
		s.add( new Title("Thinking in Java - volume 1", "Bruce Eckel", "Manuale di Java. I fondamenti", "8871923030", 2006, "Pearson", LIBRO));
		s.add( new Title("Thinking in Java - volume 1", "Bruce Eckel", "Manuale di Java. I fondamenti", "8871923030", 2006, "Pearson", LIBRO));
		
		};	
	*/
	
	public MemoryTitleManager() {
		// TODO Auto-generated constructor stub
	}

	@Override
	public void createTitle(Title title) throws BusinessException{
		
	}

	@Override
	public List<Title> findAllTitles() throws BusinessException{
		return titles;
	}

}
